package com.itheima.properties;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
import java.util.Scanner;

public class Demo1 {
    public static void main(String[] args) throws IOException {
        Properties pop = new Properties();
        pop.load(new FileReader("day13_字符流&properties\\b.txt"));

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名:");
        String userName = sc.next();
        System.out.println("请输入密码:");
        String passWord = sc.next();

        String realPass = pop.getProperty(userName);
        if(passWord.equals(realPass)){
            System.out.println("登录成功");
        }else{
            System.out.println("登录失败");
        }
    }
}
